<!DOCTYPE html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'riskWarningConfig.label', default: 'riskWarningConfig')}"/>
    <title>预警配置</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>预警配置</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                预警配置
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="index" class="form-horizontal" role="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i>重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group">
                    <div class="row flex">
                        <div class="form-group col-md-4">
                            <label class="col-sm-3 control-label">名称</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" value="${params?.name}" id="name" name="name"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link action="create" class="btn btn-info btn-xs"><i class="fa fa-plus"></i>新建</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部预警配置
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="name" title="名称" class="text-center" params="${params}"/>
                            <g:sortableColumn property="type" title="类型" class="text-center" params="${params}"/>
                            <g:sortableColumn property="status" title="状态" class="text-center" params="${params}"/>
                            <g:sortableColumn property="duration" title="执行周期" class="text-center" params="${params}"/>
                            <g:sortableColumn property="limitCounts" title="最大条数" class="text-center" params="${params}"/>
                            <g:sortableColumn property="workflow" title="工作流" class="text-center" params="${params}"/>
                            <g:sortableColumn property="chartType" title="图表类型" class="text-center" params="${params}"/>
                            <g:sortableColumn property="chartStatus" title="图表状态" class="text-center" params="${params}"/>
                            <g:sortableColumn property="description" title="描述" class="text-center" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${riskWarningConfigList}">
                            <tr align="center">
                                <td>
                                    <g:link style="color: #3498DB" action="show" id="${it?.id}">${it?.name}</g:link>
                                </td>
                                <td>${it?.type}</td>
                                <td>${it?.status == 1 ? '启用' : '禁用'}</td>
                                <td>
                                    <g:if test="${it.duration == 'week'}">周末</g:if>
                                    <g:elseif test="${it.duration == 'month'}">月末</g:elseif>
                                    <g:elseif test="${it.duration == 'quarter'}">季末</g:elseif>
                                    <g:elseif test="${it.duration == 'year'}">年末</g:elseif>
                                </td>
                                <td>${it?.limitCounts}</td>
                                <td>${it?.workflow?.name}</td>
                                <td>${it?.chartType}</td>
                                <td>${it?.chartStatus == 1 ? '启用' : '禁用'}</td>
                                <td>${it?.description}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${riskWarningConfigCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>
    $(function ()
    {
        //重置按钮
        $("#resetBtn").click(function () {
            $("#name").val("");
        });
    })
</g:javascript>

</body>
</html>